package com.ahtcm.tcmlearning.dao;

import com.ahtcm.tcmlearning.model.Question;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuestionMapper {
    int deleteByPrimaryKey(Integer questionId);

    int insert(Question record);

    int insertSelective(Question record);

    Question selectByPrimaryKey(Integer questionId);

    int updateByPrimaryKeySelective(Question record);

    int updateByPrimaryKey(Question record);

    /**
     * @description 获得相应类目的题目
     * @author yangrongdeng
     * @param categoryId 类目
     * @param beginQuestionId 题目的起始位置
     * @param questionCount 题目的数量
     * @return
     */
    List<Question> getQuestion(@Param("categoryId") Integer categoryId, @Param("beginQuestionId") Integer beginQuestionId,@Param("questionCount") Integer questionCount);

    /**
     * @description 题目表中此类型题目最后一条问题
     * @author yangrongdeng
     * @param categoryId
     * @return
     */
    Question theLastQuestionByCategory(@Param("categoryId")Integer categoryId);
}